﻿<controls:ChildWindow x:Class="SomethingSpacial.Views.Admin.SponsorAdd"
            xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"  
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
            Width="500" Height="500" 
            xmlns:vm="clr-namespace:SomethingSpacial.ViewModel"
            Title="Add a Sponsor">
            <controls:ChildWindow.DataContext>
                <vm:SponsorsViewModel x:Name="vmSponsors"  />
            </controls:ChildWindow.DataContext>
    
    <Grid x:Name="LayoutRoot" Margin="2">


        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        

        <dataControls:DataForm x:Name="addSponsorDataForm"   AutoGenerateFields="False" AutoCommit="True" AutoEdit="True" CommandButtonsVisibility="None">
            <dataControls:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel>
                        <dataControls:DataField Label="Sponsor Name:" >
                            <TextBox Text="{Binding SponsorName, Mode=TwoWay}"  Width="200" HorizontalAlignment="Left" />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Description:">
                            <TextBox Text="{Binding  SponsorDescription, Mode=TwoWay}" Width="280" Height="120" HorizontalAlignment="Left"  TextWrapping="Wrap" />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Sponsor URL:">
                            <TextBox Text="{Binding SponsorURL, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Logo Filename:">
                            <TextBox Text="{Binding LogoFilename, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                        </dataControls:DataField>
                        <dataControls:DataField Label="IsActive">
                            <TextBox Text="{Binding IsActive, Mode=TwoWay}" HorizontalAlignment="Left"  />
                        </dataControls:DataField>
                    </StackPanel>
                </DataTemplate>

            </dataControls:DataForm.EditTemplate>
        </dataControls:DataForm>


        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>